package cn.toutatis.sandbox.root.systemService.entity;

import cn.toutatis.common.controllerDepand.EntityBasicAttribute;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 静态字典
 * </p>
 *
 * @author Toutatis_Gc
 * @since 2020-07-09
 */
public class SystemDictionary extends EntityBasicAttribute<SystemDictionary> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    /**
     * 父id
     */
    @TableField("parentId")
    private Integer parentId;

    /**
     * 编码
     */
    @TableField("`code`")
    private String code;

    /**
     * 名称
     */
    @TableField("`name`")
    private String name;

    /**
     * 分类
     */
    private String classify;

    /**
     * 权重
     */
    private Integer weight;

    /**
     * 级别
     */
    @TableField("`level`")
    private String level;

    /**
     * 状态
     */
    @TableField("`status`")
    private String status;

    @TableField(exist = false)
    private List<SystemDictionary> children;

    @TableField(exist = false)
    private Integer childCount;

    @TableField(exist = false)
    private boolean hasChildren;

    public Integer getChildCount() {
        return childCount;
    }

    public void setChildCount(Integer childCount) {
        this.childCount = childCount;
    }

    public List<SystemDictionary> getChildren() {
        return children;
    }

    public void setChildren(List<SystemDictionary> children) {
        this.children = children;
    }

    public boolean isHasChildren() {
        return childCount != null && childCount > 0;
    }

    public void setHasChildren(boolean hasChildren) {
        this.hasChildren = hasChildren;
    }

    public Integer getParentId() {
        return parentId;
    }


    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }
    public String getCode() {
        return code;
    }


    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }


    public void setName(String name) {
        this.name = name;
    }
    public String getClassify() {
        return classify;
    }


    public void setClassify(String classify) {
        this.classify = classify;
    }
    public Integer getWeight() {
        return weight;
    }


    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    public String getLevel() {
        return level;
    }


    public void setLevel(String level) {
        this.level = level;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Override
    public String getStatus() {
        return status;
    }

    @Override
    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    protected Serializable pkVal() {
        return null;
    }

    @Override
    public String toString() {
        return "\r\nSystemDictionary{" +
                "id=" + id +
                ", parentId=" + parentId +
                ", code='" + code + '\'' +
                ", name='" + name + '\'' +
                ", classify='" + classify + '\'' +
                ", weight=" + weight +
                ", level='" + level + '\'' +
                ", status='" + status + '\'' +
                ", children=" + children +
                ", childCount=" + childCount +
                ", hasChildren=" + hasChildren +
                ", reservedId=" + reservedId +
                ", reservedMsg='" + reservedMsg + '\'' +
                ", createTime=" + createTime +
                ", lastUpdateTime=" + lastUpdateTime +
                ", status='" + status + '\'' +
                '}';
    }
}
